package com.utooo.controller;

import com.utooo.constant.ResultCodeConstant;
import com.utooo.pojo.dto.common.RestResult;
import com.utooo.service.quality.InspectionTaskService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author CK
 * @Date: 2025−04-23 16:23
 * @Description: 质量管理
 * @Copyright: 南京优通信息科技股份有限公司
 */
@Tag(name = "质量管理")
@RequestMapping("/quality")
@RestController
public class QualityController {

    @Resource
    private InspectionTaskService inspectionTaskService;


    @RequestMapping(value = "/inspection/task/add", method = RequestMethod.POST)
    @Operation(summary = "订单收货后生成进货查验任务")
    public RestResult<Void> addInspectionTask(@RequestParam String orderReceiptId) {
        inspectionTaskService.addInspectionTask(orderReceiptId);
        return new RestResult<>(ResultCodeConstant.CODE_200, ResultCodeConstant.CODE_200_MSG);
    }
}
